How Does Hoisting Work with 'var' in JavaScript and What is Global Scope